package com.lunivore.stirry.exampleapp

import javafx.application.Application
import javafx.beans.binding.StringBinding
import javafx.beans.property.SimpleStringProperty
import javafx.geometry.Insets
import javafx.scene.Scene
import javafx.scene.control.*
import javafx.scene.layout.BorderPane
import javafx.scene.layout.GridPane
import javafx.scene.layout.HBox
import javafx.scene.paint.Color
import javafx.scene.text.Font
import javafx.stage.Stage

class ExampleApp : Application() {

    val gridPane = GridPane()
    val tabPane = TabPane()
    val borderPane=BorderPane()

    override fun start(primaryStage: Stage) {

        val tab1 = Tab()
        val tab2 = Tab()

        gridPane.add(Button("One"), 0, 0)
        gridPane.add(Button("Two"), 0, 1)
        gridPane.add(TextField(), 0, 2)
        gridPane.add(DatePicker(), 0, 3)
        gridPane.add(CheckBox(), 0, 4)

        gridPane.apply {
            padding= Insets(10.0)
            vgap=10.0
            hgap=10.0

        }

        borderPane.center=gridPane

        borderPane.top=HBox(10.0, *listOf(Label("msg:"),Label("msg").apply {
            textFill=Color.RED
            minWidth=600.0
            minHeight=20.0
            font= Font.font("",50.0)
        }).toTypedArray())

        tab1.content = borderPane
        tab2.content = GridPane()
        tabPane.tabs.addAll(tab1, tab2)
        primaryStage.width=800.0
        primaryStage.height=600.0
        primaryStage.scene = Scene(tabPane)
        primaryStage.show()
    }

    companion object {
        @JvmStatic fun main(args: Array<String>) {
            launch(ExampleApp::class.java, *args)
        }
    }
}